import 'package:flutter/material.dart';

class AnimatedWidgetLogoApp extends StatefulWidget {
  @override
  _AnimatedWidgetLogoAppState createState() => _AnimatedWidgetLogoAppState();
}

class _AnimatedWidgetLogoAppState extends State<AnimatedWidgetLogoApp>
with SingleTickerProviderStateMixin {
  AnimationController animationController ;
  Animation<double> animation;
  bool isForward = true;

  @override
  void initState() {
    super.initState();
    animationController = new AnimationController(vsync: this,
    duration: Duration(milliseconds: 2000));
    animation = Tween(begin: 0.0,end: 200.0).animate(animationController)
    ..addStatusListener((status){
      if(status == AnimationStatus.completed){

      }
    })..addListener((){
        print(animation.value);
      });

    animationController.forward();
  }

  @override
  Widget build(BuildContext context) {
    return AnimatedLogoWidget(animation: animation,);
  }
}

class AnimatedLogoWidget extends AnimatedWidget{
  AnimatedLogoWidget({Key key,this.animation})
      :super(key:key,listenable:animation);
  final Animation<double> animation;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        margin: EdgeInsets.symmetric(vertical: 10.0),
          height: animation.value,
        width: animation.value,
        child: FlutterLogo(),
      ),
    );
  }

}
